package com.vf.i.mvc.controller;

import java.util.List;

import com.jfinal.aop.Inject;
import com.jfinal.kit.StrKit;
import com.jfinal.log.Log;
import com.vf.core.controller.BaseController;
import com.vf.i.mvc.service.SceneService;
import com.vf.s.common.model.biz.BizScene;
import com.vf.s.common.model.biz.BizSceneMenu;

public class SceneController extends BaseController {

	protected final Log LOG = Log.getLog(getClass());
	
	
	//http://localhost:8080/vf/i/scene/get(sceneId) 
	//http://localhost:8080/vf/i/scene/layer/get(sceneId,menuId) 	
	//http://localhost:8080/vf/i/scene/layer/getById(layerId) 	
	
	@Inject
	private SceneService srv;
	
	public void get() {
		String sceneId = this.getPara("sceneId");
		String menuId = this.getPara("menuId");
		
		if(StrKit.isBlank(sceneId)) {
			this.renderError("参数必填！");
			return;
		}
		
		BizScene scene=BizScene.dao.findById(sceneId);
		if(scene==null) {
			this.renderError("场景不存在！");
			return;
		}
		this.renderSuccess("成功！",scene);
		
		if(!StrKit.isBlank(menuId)) {
			List<BizSceneMenu> layers= srv.getLayers(sceneId,menuId);
		}
	}

}
